package com.definity.toolkit.ui.widget;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;

import javax.swing.JToolBar;

import com.definity.toolkit.ui.Body;

public class ToolBar extends JToolBar implements Widget<ToolBar> {

	private static final long serialVersionUID = 5652759369711548398L;

	public ToolBar() {

	}
	
	@Override
	public String id() {
		return getName();
	}

	@Override
	public ToolBar id(String id) {
		setName(id);
		return this;
	}

	@Override
	public ToolBar properties(Body<ToolBar> body) {
		body.content(this);
		return this;
	}

	@Override
	public ToolBar size(int width, int height) {
		setPreferredSize(new Dimension(width, height));
		return this;
	}
	
	public ToolBar add(Button button) {
		super.add(button);
		return this;
	}
	
	public ToolBar separator() {
		super.addSeparator();
		return this;
	}

	@Override
	public Color background() {
		return getBackground();
	}

	@Override
	public ToolBar background(Color background) {
		setBackground(background);
		return this;
	}

	@Override
	public Color foreground() {
		return getForeground();
	}

	@Override
	public ToolBar foreground(Color foreground) {
		setForeground(foreground);
		return this;
	}

	@Override
	public Font font() {
		return getFont();
	}

	@Override
	public ToolBar font(Font font) {
		setFont(font);
		return this;
	}

}
